package ocg.http.httpcore;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by chenbo on 2018/4/24.
 */
public abstract class HttpModel {

    /* 接口链接 */
    protected String url = null;
    protected String model = null;
    /* 接口请求头 */
    protected Map<String,String> headers = new HashMap <String, String> ( );
    /* 接口请求body */
    protected String body = null;
    /* 接口请求cookies */
    protected Map<String,String> cookies = new HashMap <String, String> ( );
    protected Map<String,String> parameters = new HashMap <> (  );

    abstract HttpModel headers( Map<String,String> headers);
    abstract HttpModel header( String key , String value );
    abstract HttpModel cookies( Map<String,String> cookies );
    abstract HttpModel cookie( String key , String value );
    abstract HttpModel body( String body);
    abstract HttpModel parameter( String key , String value);
    abstract HttpModel parameters( Map<String,String> parameters);

    public String getUrl() {
        return url;
    }

    public String getModel() {
        return model;
    }

    public Map <String, String> getHeaders() {
        return headers;
    }

    public String getBody() {
        return body;
    }

    public Map <String, String> getCookies() {
        return cookies;
    }

    public Map <String, String> getParameters() {
        return parameters;
    }
}
